package com.kefu.exam.controller;

import com.kefu.common.annotation.Permission;
import com.kefu.common.controller.AbstractBaseController;
import com.kefu.common.result.Result;
import com.kefu.common.result.ResultGenerator;
import com.kefu.exam.service.ExamSubjectTypeService;
import com.kefu.exam.vo.ExamSubjectTypeSearchVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author xy
 * @date 2022/02/28
 */
@Api(tags = "考题分类表")
@RestController
@RequestMapping("exam/subjectType")
public class ExamSubjectTypeController extends AbstractBaseController {
    @Resource
    private ExamSubjectTypeService examSubjectTypeService;

    @PostMapping("/list")
    @ApiOperation(value = "查询考题分类表", notes = "查询考题分类表")
    public Result<List> list(@Validated @RequestBody ExamSubjectTypeSearchVo search) {
        logger.info("查询考题分类表:{}", search);
        
        return ResultGenerator.genSuccessResult(examSubjectTypeService.list(search.getExample()));
    }
}
